package com.cf.conf.core.model;

import com.cf.code.core.CField;
import com.cf.code.core.CModel;
import com.cf.code.core.CPage;
import com.cf.crud.entity.BaseEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * game-server-Config
 *
 * @author <a href="2428922347@qq.com">Zhu mingming</a>
 * @info
 * @since 2018/6/8 下午 05:33
 */
@Entity
@Table(name = "config", uniqueConstraints = {
        @UniqueConstraint(columnNames = {"app","profile","key"})
})
@CModel(pages = {
        @CPage(title = "配置中心列表", path = "config", templateName = "list.ftl", outPutName = "list.ftl"),
        @CPage(title = "配置", path = "config", templateName = "add.ftl", outPutName = "add.ftl"),
        @CPage(title = "配置", path = "config", templateName = "update.ftl", outPutName = "update.ftl")
})
public class Config extends BaseEntity {

    @CField(lab = "应用", search = true)
    private String app;

    @CField(lab = "环境", search = true)
    @Column(name = "`profile`")
    private String profile;

    @CField(lab = "属性键", search = true)
    @Column(name = "`key`")
    private String key;

    @CField(lab = "属性值", search = true)
    @Column(name = "`value`")
    private String value;

    public String getApp() {
        return app;
    }

    public void setApp(String app) {
        this.app = app;
    }

    public String getProfile() {
        return profile;
    }

    public void setProfile(String profile) {
        this.profile = profile;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }
}
